package com.bsoft.exchange.controller.appointmentandregistration;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.bsoft.exchange.domain.Department;
import com.bsoft.exchange.pojo.ListDepartmentPojo;
import com.bsoft.exchange.response.ResponseEntity;
import com.bsoft.exchange.service.DepartmentService;

import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping(value = "appointment")
public class DepartmentController {
	@Autowired
	private DepartmentService departmentService;

	private static final Logger logger = LoggerFactory.getLogger(DepartmentController.class);

	@ApiOperation(value = "科室信息获取")
	@RequestMapping(value = "/listDepartment",method = RequestMethod.POST,produces = "application/json")
//	public List<Department> selectList(@RequestParam(value = "hospitalCode") String hospitalCode,
//			@RequestParam(value = "query",required = false) String query,
//			@RequestParam(value = "outpatientType") int outpatientType,
//			@RequestParam(value = "lastModifyTime",required = false) Date lastModifyTime) {
//		return departmentService.selectList(hospitalCode,query,outpatientType,lastModifyTime);
	
	public ResponseEntity<List<Department>> selectList(@RequestBody ListDepartmentPojo listDepartmentPojo) {
		logger.info("listDepartmentPojo ---> {}",listDepartmentPojo);
		List<Department> departmentList = departmentService.selectList(listDepartmentPojo.getOrganizationId(),listDepartmentPojo.getOutpatientType(),listDepartmentPojo.getDepartmentId(), listDepartmentPojo.getLastModifyTime());
		ResponseEntity<List<Department>> entity=new ResponseEntity<>();
		entity.setData(departmentList);
		
		return entity;
	}
	
	

}
